home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / viewwrld / viewwrld.lha / viewworld / Makefile next >
Encoding:
Makefile  |  1989-09-21  |  10.3 KB  |  279 lines

  1. # $Id: Makefile,v 1.7 89/09/21 11:28:28 mbp Exp $
  2.  
  3. # Master makefile for viewwld
  4.  
  5. # Note: Viewwld uses two libraries called GR and LGD.  This makefile
  6. # builds these libraries and then compiles/installs viewwld. If you
  7. # are installing LGD and GR separately from viewwld, do not use this
  8. # makefile.  Use the individual makefiles for LGD, GR, and viewwld.
  9. # Specifically, you should follow the installation instructions in the
  10. # README files in the gr, lgd, and viewwld subdirectories.
  11.  
  12. ### Instructions:
  13. ###
  14. ### A. For quick and dirty compilation:
  15. ###      Just type 'make'.  This will create the executable file
  16. ###      'viewwld' and the manual page 'viewwld.1' in the viewwld
  17. ###     subdirectory.
  18. ###
  19. ###      This should be sufficent on most systems.  Note, however,
  20. ###      that the resulting program will break if you delete the
  21. ###      source code.  To eliminate this problem, or if you get an
  22. ###      error, use method B.
  23. ###
  24. ###     Note: after the 'make', the pathname of the executable file
  25. ###     relative to this dir will be viewwld/viewwld.  If you
  26. ###     named the top viewwld directory 'viewwld', then the complete
  27. ###     pathname of the executable will be something like
  28. ###     /u/yourlogin/viewwld/viewwld/viewwld. (Sorry!)
  29. ###
  30. ### B. For 'official' compilation:
  31. ###      Make the changes indicated in this makefile below, and then
  32. ###      type 'make'.  This will create the executable file 'viewwld'
  33. ###      and the manual page viewwld.x (where you specify the
  34. ###      extension x) in this directory.
  35. ###
  36. ### C. To install:
  37. ###      Make the changes indicated in this makefile below, and then
  38. ###      type 'make install'.  This will do the following things
  39. ###      (unless you prevent some of them as described below):
  40. ###
  41. ###     1. Compile viewwld as in B above
  42. ###     2. Copy the file viewwld/viewwld.hlp to a permanent directory,
  43. ###         creating this directory if it doesn't exist
  44. ###     3. Copy the files gr/gr_{header,trailer}.ps to a permanent
  45. ###          directory, creating this directory if it doesn't exist
  46. ###     3. Strip the executable file and move it to a permanent bin
  47. ###          directory
  48. ###     4. Move the manual page to a permanent manual directory
  49. ###     5. Copy the SunView defaults file lgd/sunview/LGD.d to a
  50. ###          directory that is searched by defaultsedit(1)
  51. ###
  52. ### D. To clean up the viewwld dir:
  53. ###      Type 'make clean'; this deletes all intermediate files but
  54. ###      leaves the final product files (executables, libraries, etc).
  55. ###      To delete the final product files too, essentially returning
  56. ###      the viewwld directory to its original state, type 'make
  57. ###      veryclean'.
  58.  
  59. ##############################################
  60. #        BEGIN CONFIGUATION SECTION         #
  61. #                         #
  62. # Change the macros below to suit your needs #
  63. ##############################################
  64.  
  65. # The following line must be hard-coded if not using csh; if you are
  66. # not using csh (the C-shell), remove the comment char from this line
  67. # and change the path to the complete path of the main viewwld dir
  68. # (the one containing this makefile):
  69. #PWD=/u/yourlogin/viewwld
  70.  
  71. # Floating point option; should be one of
  72. #    -f68881 for MC68881 coprocessor
  73. #    -ffpa for FBA board
  74. #    -fsoft (or null) for software operations (the default)
  75. FOPTION=
  76.  
  77. # Additional compiler options (such as -O, -g, etc):
  78. OPTIONS=-O
  79.  
  80. # HELPDIR should be the pathname of directory containing the file
  81. # 'viewwld.help'.  Viewwld needs this file at run-time, so you should
  82. # probably install it in some permanent location (rather than with the
  83. # source code), such as /usr/local/lib/viewwld.
  84. #
  85. # When doing 'make install', HELPDIR is created if it does not exist,
  86. # and if the file 'viewwld.help' does not exist in HELPDIR, it will be
  87. # copied into it.  You should be sure that you have write permission
  88. # in HELPDIR, or in its parent if it does not yet exist.
  89. #
  90. # The current (uninstalled) location of viewwld.help is the 'viewwld'
  91. # subdirectory; if you want to leave it there, specify
  92. # HELPDIR=$(PWD)/viewwld
  93. HELPDIR=$(PWD)/viewwld
  94.  
  95. # PSDIR should be the pathname of directory containing the GR
  96. # PostScript files gr_header.ps and gr_trailer.ps.  Viewwld needs
  97. # these file at run-time, so you should probably install them in some
  98. # permanent location (rather than with the source code), such as
  99. # /usr/local/lib/viewwld.
  100. #
  101. # When doing 'make install', PSDIR will be created if it does not
  102. # exist, and if either gr_header.ps or gr_trailer.ps does not exist in
  103. # PSDIR, it will be copied into it.  You should be sure that you have
  104. # write permission in PSDIR, or in its parent if it does not yet
  105. # exist.
  106. #
  107. # The current (uninstalled) location of gr_header.ps and gr_trailer.ps
  108. # is the 'gr' subdirectory; if you want to leave them there, specify
  109. # PSDIR=$(PWD)/gr
  110. PSDIR=$(PWD)/gr
  111.  
  112. # DEFAULT_SPOOL_COMMAND should be a shell command for printing
  113. # PostScript files.  It may consists of one or more words separated by
  114. # whitespace, and it should take a single argument, which is the name
  115. # of a PostScript file to be printed.  Likely values are "lpr", "lpr
  116. # -plw2", etc.  If your system has no way to print PostScript files,
  117. # you should set DEFAULT_SPOOL_COMMAND to nothing; in this case the
  118. # '=' sign should be the last thing on this line; no trailing space!
  119. DEFAULT_SPOOL_COMMAND=lpr
  120.  
  121. #########################################################################
  122. ### The remaining macros are only used by 'make install'.  If you are
  123. ### just going to compile viewwld without installing it, you can
  124. ### ingore everything below this point.
  125. ###
  126. ### Most of the following macros specify the names of directories into
  127. ### which viewwld and its supporting files should be installed.  For
  128. ### each of these macros, the makefile will install the corresponding
  129. ### file only if the macro has a value.  Hence, if you want to prevent
  130. ### the makefile from installing a particular file or files, just comment
  131. ### out the corresponding macro definition.
  132. ###
  133. ### Each of the directories you specify here should exist and should
  134. ### be writable by you before you do 'make install'.
  135. #########################################################################
  136.  
  137. # BINDIR should be the directory in which you want to install the
  138. # executable file (used only by 'make install').  Should probably be
  139. # /usr/local/bin.
  140. BINDIR=/usr/local/bin
  141.  
  142. # SAMPLEDIR should be the directory in which you want to install the
  143. # example vector (intput) files which come with viewwld.  To leave them
  144. # where they are now (with the source code in the viewwld subdirectory),
  145. # specify SAMPLEDIR=$(PWD)/viewwld.
  146. SAMPLEDIR=$(PWD)/viewwld
  147.  
  148. # MANEXT should be the extension which you want to use for the manual
  149. # page.  Should probably be l or 1.  Do not comment out this
  150. # definition!
  151. MANEXT=1
  152.  
  153. # MANDIR should be the directory in which you want to install the
  154. # viewwld manual page (used only by 'make install').  Should probably be
  155. # /usr/local/man.  (Note: the extension subdirectory will be appended to
  156. # the value of MANDIR; for example if MANEXT=1 and
  157. # MANDIR=/usr/local/man, the manual page will be installed in the dir
  158. # /usr/local/man/man1.)
  159. MANDIR=/usr/local/man
  160.  
  161. # DEFAULTSDIR should be the directory in which you want to install the
  162. # viewwld defaults file (which is named 'LGD.d').  This file must be
  163. # installed in a directory (probably /usr/lib/defaults) that is searched
  164. # by the program defaultsedit(1) if you want users to be able to use
  165. # defaultsedit to set customized values for viewwld parameters.  If you
  166. # do not install this file, users can still set customized viewwld
  167. # parameter values by editing the file '.defaults' in their home
  168. # directories manually.  (See the viewwld manual page for more details.)
  169. DEFAULTSDIR=/usr/lib/defaults
  170.  
  171. ##############################################
  172. #         END CONFIGUATION SECTION         #
  173. #                         #
  174. #     Don't change anything below here       #
  175. ##############################################
  176.  
  177. PSFILES = gr/gr_header.ps gr/gr_trailer.ps
  178. DEFAULTSFILE = lgd/sunview/LGD.d
  179.  
  180. all:    all_quietly
  181.     @echo ''
  182.     @echo Viewwld compilation is complete.
  183.     @echo ''
  184.     @echo The executable file is:
  185.     @echo '  ' $(PWD)/viewwld/viewwld.
  186.     @echo The manual page file is:
  187.     @echo '  ' $(PWD)/viewwld/viewwld.$(MANEXT)
  188.     @echo ''
  189.  
  190. all_quietly:
  191.     cd gr ; make libgr3d.a \
  192.             PWD=$(PWD)/gr \
  193.             FOPTION=$(FOPTION) \
  194.             OPTIONS="$(OPTIONS)" \
  195.             AUXDIR=$(PSDIR) \
  196.             DEFAULT_SPOOL_COMMAND="$(DEFAULT_SPOOL_COMMAND)"
  197.     cd lgd ; make liblgd.a \
  198.             PWD=$(PWD)/gr \
  199.             FOPTION=$(FOPTION) \
  200.             OPTIONS="$(OPTIONS)" \
  201.             GR_HEADER=$(PWD)/gr/gr.h \
  202.             DEFAULTSDIR=$(DEFAULTSDIR)
  203.     cd viewwld ; make            \
  204.             PWD=$(PWD)/gr        \
  205.             FOPTION=$(FOPTION)    \
  206.             OPTIONS="$(OPTIONS)"    \
  207.             HELPDIR=$(HELPDIR)    \
  208.             SAMPLEDIR=$(SAMPLEDIR)    \
  209.             PSDIR=$(PSDIR)        \
  210.             LGDLIB=../lgd/liblgd.a    \
  211.             GRLIB=../gr/libgr3d.a    \
  212.             GR_HEADER=../gr/gr.h    \
  213.             LGD_HEADER=../lgd/lgd.h \
  214.             MANEXT=$(MANEXT)    \
  215.             all
  216.  
  217. install:    all_quietly install_viewwld install_ps install_defaults
  218.     @echo ''
  219.     @echo viewwld installation complete
  220.     @echo ''
  221.  
  222. install_viewwld:
  223.     cd viewwld ; make            \
  224.             PWD=$(PWD)/gr        \
  225.             FOPTION=$(FOPTION)    \
  226.             OPTIONS="$(OPTIONS)"    \
  227.             HELPDIR=$(HELPDIR)    \
  228.             LGDLIB=../lgd/liblgd.a    \
  229.             GRLIB=../gr/libgr3d.a    \
  230.             GR_HEADER=../gr/gr.h    \
  231.             LGD_HEADER=../lgd/lgd.h    \
  232.             BINDIR=$(BINDIR)    \
  233.             MANEXT=$(MANEXT)    \
  234.             MANDIR=$(MANDIR)    \
  235.             SAMPLEDIR=$(SAMPLEDIR)    \
  236.             install_quietly
  237.  
  238. install_ps:
  239.     @if test "$(PSDIR)" != "$(PWD)/gr" ; then        \
  240.       if test -f $(PSDIR) ; then                \
  241.         echo ERROR: PSDIR \($(PSDIR)\) is not a directory ;    \
  242.         exit 1 ;                        \
  243.       fi ;                            \
  244.       if test ! -d $(PSDIR) ; then                \
  245.         echo mkdir $(PSDIR) ;                \
  246.         mkdir $(PSDIR) ;                    \
  247.       fi ;                            \
  248.       echo cp $(PSFILES) $(PSDIR) ;                \
  249.       cp $(PSFILES) $(PSDIR) ;                \
  250.     fi
  251.  
  252. install_defaults:
  253.     @if test "$(DEFAULTSDIR)" != "" ; then                \
  254.       if test ! \( -d $(DEFAULTSDIR) -a -w $(DEFAULTSDIR) \) ; then    \
  255.         echo '' ;                            \
  256.         echo DEFAULTSDIR = $(DEFAULTSDIR) ;                \
  257.         echo is not an existing directory in which you have write ; \
  258.         echo permission.  Try installing again after making sure ;    \
  259.         echo that the directory you give for DEFAULTSDIR in the ;    \
  260.         echo Makefile exists and that you can write in it. ;    \
  261.         echo '' ;                            \
  262.         exit 1 ;                            \
  263.       fi ;                                \
  264.       echo cp $(DEFAULTSFILE) $(DEFAULTSDIR) ;            \
  265.       cp $(DEFAULTSFILE) $(DEFAULTSDIR) ;                \
  266.     fi
  267.  
  268. clean:
  269.     /bin/rm -f *~  *% *.man #*#
  270.     cd gr ; make clean
  271.     cd lgd ; make clean
  272.     cd viewwld ; make clean
  273.  
  274. veryclean:
  275.     /bin/rm -f *~  *% *.man #*#
  276.     cd gr ; make veryclean
  277.     cd lgd ; make veryclean
  278.     cd viewwld ; make veryclean
  279.